<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <script src="/layui/layui.js"></script>
    <script src="/js/jquery/jquery-3.5.1.js"></script>
    <script src="/js/book/book.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/bookList.css">
    <title>规则设置</title>
    <style>
        .layui-form-item{
            margin-bottom: 1px;
        }
        .layui-form-label {
            font-size: 10px;
            width: 90px;
        }
    </style>
</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">书源</label>
            <div class="layui-input-inline">
                <input type="text" name="bookSourceUrl" lay-verify="bookSourceUrl"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">书源名称</label>
            <div class="layui-input-inline">
                <input type="text" name="bookSourceName"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">书源分类</label>
            <div class="layui-input-inline">
                <input type="text" name="bookSourceGroup"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">登录url</label>
            <div class="layui-input-inline">
                <input type="text" name="loginUrl" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索url</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchUrl"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索列表</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchList"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">搜索书名</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchName" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索作者</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchAuthor"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索分类</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchKind"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">搜索最新章节</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchLastChapter" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索简介</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchIntroduce"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">搜索封面</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchCoverUrl"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">搜索书籍url正则</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleSearchNoteUrl" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">书籍详情url正则</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookUrlPattern"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">书籍详情预处理</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookInfoInit"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">书名</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookName" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">作者</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookAuthor"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">封面</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleCoverUrl" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">简介</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleIntroduce" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookKind"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">最新章节</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookLastChapter"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">目录url</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleChapterUrl" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">目录下一页</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleChapterUrlNext" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">目录列表</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleChapterList"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">目录章节名称</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleChapterName" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">章节url</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleContentUrl"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">正文下一页</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleContentUrlNext"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">正文规则</label>
            <div class="layui-input-inline">
                <input type="text" name="ruleBookContent" lay-verify="title"  placeholder="请输入标题" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item" style="text-align: center">
        <div class="layui-input-block" >
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="saveRule">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>


    <script>
        layui.use('form', function(){
            var form = layui.form;
            //监听提交
            form.on('submit(saveRule)', function(data){
                var rs = JSON.stringify(data.field)
                $.ajax({
                    type:"put",
                    url: "/book/saveOrupdate",
                    data:JSON.stringify(data.field),
                    dataType:"json",
                    contentType : "application/json; charset=utf-8",
                    success: function(result){
                    }
                });
                return false;
            });
        });



    </script>

</form>
</body>
</html>